﻿//-----------------------------------------------------------------------
// <copyright file="PublishExceptionCompletedEventArgs.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Silverlight
{
    using System;
    using System.ComponentModel;

    /// <summary>
    /// Provides data for the <see cref="M:DiagnosticsServiceClient.PublishExceptionCompleted"/> event. 
    /// </summary>
    public sealed class PublishExceptionCompletedEventArgs : AsyncCompletedEventArgs
    {
        #region PublishExceptionCompletedEventArgs Private Fields

        /// <summary>
        /// An object array containing the results of the asynchronous operation.
        /// </summary>
        private object[] results;

        #endregion

        #region public PublishExceptionCompletedEventArgs(object[] results, Exception exception, bool canceled, object state) : base(exception, canceled, state)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:PublishExceptionCompletedEventArgs"/> class.
        /// </summary>
        /// <param name="results">The results.</param>
        /// <param name="exception">Any error that occurred during the asynchronous operation.</param>
        /// <param name="canceled">A value indicating whether the asynchronous operation was canceled.</param>
        /// <param name="state">The optional user-supplied state object.</param>
        public PublishExceptionCompletedEventArgs(object[] results, Exception exception, bool canceled, object state) : base(exception, canceled, state)
        {
            this.results = results;
        }

        #endregion

        #region public Guid PublicationId

        /// <summary>
        /// Gets the publication Id of the exception.
        /// </summary>
        /// <value>The publicationId of the exception.</value>
        public Guid PublicationId
        {
            get
            {
                //base.RaiseExceptionIfNecessary();
               
                //return (Guid) this.results[0];
                
                return Guid.Empty;
            }
        }

        #endregion
    }
}
